package com.credithc.signature.common.ro.manager;

import com.credithc.signature.common.annotation.EndTime;
import com.credithc.signature.common.annotation.LikeSearch;
import com.credithc.signature.common.annotation.StartTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class TemplateRo {

    Long id;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", locale = "zh")
    @StartTime
    Date createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", locale = "zh")
    @EndTime
    Date updateTime;
    String templateNo;
    @LikeSearch(value = true)
    String templateName;
    Integer templateStatus;
    Integer templateStatusName;

    public void setSealType(String sealType) {
        try {
            this.sealType = Integer.valueOf(sealType);
        } catch (Exception e) {
            if ("私章".equals(sealType)){
                this.sealType =1;
            }else if ("公章".equals(sealType)){
                this.sealType =2;
            }else if ("公私章".equals(sealType)){
                this.sealType = 3;
            }
        }
    }
    public void setSealType(Integer sealType) {
        this.sealType = sealType;
    }
    Integer sealType;
    Integer resource;
    String sealTypeName;
    String remark;
    String version;
    String refId;
    String channelNo;
    String fileData;
    String[] officialSealId;
    Integer auditStatus;
    Integer enableStatus;
    Integer disableStatus;
    @Builder.Default
    Integer queryPageNo = 0;
    Integer pageNo;
    Integer pageSize;
    String requestData;
    List<String> approverIds;
    List<UserInfoRo> userInfoRos;
    Integer approvalId;
    String createId;
    String createName;
    String operatorId;
    String operatorName;
    String channelIds;
}
